<?php
/**
 * DynaGrid - The PHP datagrid
 *
 * @package    DynaGrid
 * @author     $Author: keesschepers $
 * @version    $Id: Grid.php 11 2011-02-11 23:20:17Z keesschepers $
 */

interface DynaGrid_DataSource_Adapter_Interface {
    /**
     * Set the arguments which are needed specificly by the datasource adapter
     *
     * @return void
     * @param array $arguments
     */
    public function setArguments($arguments = array());
    /**
     * Return the total amount of rows to display. Not the amount of rows for the current page!
		 * If zero returned pagebrowser will not be shown.
     *
     * @return integer
     */
    public function getTotalRows();
		public function setOffset($offset);
		public function setLimit($limit);
		/**
		 * Function must return an indexed array containing fieldnames as string value.
		 * 
		 * @todo Might be a good idea to return an array in a array containing the data
		 * type of a certain field. 
		 * 
		 * @return array
		 */
		public function getFields();
		/**
		 * The getData function returns the actual data to represent it self. It's
		 * a numeric indexed array (starting from zero) with every index another array containing
		 * fieldname=>value. The fieldname should be exact as what getFields returned.
		 */
		public function getData();
		/**
		 * You can set the order setting prefered by the client where the datasource
		 * will take care of sorting the results.
		 */
		public function setOrderBy(array $properties);
}
?>
